﻿@using MvcForum.Web.Areas.Admin.ViewModels
@{   
    var genericMessage = new GenericMessageViewModel();
    if (TempData[AppConstants.MessageViewBagName] != null)
    {
        genericMessage = (GenericMessageViewModel)TempData[AppConstants.MessageViewBagName];
    }
    else if (ViewBag.Message != null)        
    {
        genericMessage = (GenericMessageViewModel)ViewBag.Message;
    }
    var delayTime = genericMessage.ConstantMessage ? 600000 : 4500;
}

<div id="jsquickmessage" style="display:none;"></div>
@if (!string.IsNullOrEmpty(genericMessage.Message))
{
<script type="text/javascript"> $(function () { $('div.alert').delay(@delayTime).fadeOut(); });</script>
    <div class="alert alert-@genericMessage.MessageType.ToString()" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        @Html.Raw(genericMessage.Message)
    </div>
}
